home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / MacOS 8 Resources / Developer Tools / Mac OS 8 Interfaces & Libraries / Interfaces / CIncludes / ShutDown.h < prev    next >
C/C++ Source or Header  |  1996-05-01  |  3KB  |  112 lines

  1. /*
  2.      File:        ShutDown.h
  3.  
  4.      Contains:    Shutdown Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    Universal Interfaces 3.0d3 on Copland DR1
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __SHUTDOWN__
  19. #define __SHUTDOWN__
  20.  
  21. #ifndef __TYPES__
  22. #include <Types.h>
  23. #endif
  24. #ifndef __MIXEDMODE__
  25. #include <MixedMode.h>
  26. #endif
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. #if PRAGMA_IMPORT_SUPPORTED
  33. #pragma import on
  34. #endif
  35.  
  36. #if PRAGMA_ALIGN_SUPPORTED
  37. #pragma options align=mac68k
  38. #endif
  39.  
  40. #if FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE
  41.  
  42. enum {
  43.     sdOnPowerOff                = 1,                            /*call procedure before power off.*/
  44.     sdOnRestart                    = 2,                            /*call procedure before restart.*/
  45.     sdOnUnmount                    = 4,                            /*call procedure before unmounting.*/
  46.     sdOnDrivers                    = 8,                            /*call procedure before closing drivers.*/
  47.     sdRestartOrPower            = 3                                /*call before either power off or restart.*/
  48. };
  49.  
  50. /*
  51.         This ProcPtr uses register based parameters on the 68k and cannot
  52.         be written in or called from a high-level language without the help of
  53.         mixed mode or assembly glue.
  54.  
  55.             typedef pascal void (*ShutDwnProcPtr)(short shutDownStage);
  56.  
  57. */
  58.  
  59. #if GENERATINGCFM
  60. typedef UniversalProcPtr ShutDwnUPP;
  61. #else
  62. typedef Register68kProcPtr ShutDwnUPP;
  63. #endif
  64.  
  65. enum {
  66.     uppShutDwnProcInfo = kRegisterBased
  67.          | REGISTER_ROUTINE_PARAMETER(1, kRegisterD0, SIZE_CODE(sizeof(short)))
  68. };
  69.  
  70. #if GENERATINGCFM
  71. #define NewShutDwnProc(userRoutine)        \
  72.         (ShutDwnUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppShutDwnProcInfo, GetCurrentArchitecture())
  73. #else
  74. #define NewShutDwnProc(userRoutine)        \
  75.         ((ShutDwnUPP) (userRoutine))
  76. #endif
  77.  
  78. #if GENERATINGCFM
  79. #define CallShutDwnProc(userRoutine, shutDownStage)        \
  80.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppShutDwnProcInfo, (shutDownStage))
  81. #else
  82. /* (*ShutDwnUPP) cannot be called from a high-level language without the Mixed Mode Manager */
  83. #endif
  84. extern pascal void ShutDwnPower(void )
  85.  THREEWORDINLINE(0x3F3C, 0x0001, 0xA895);
  86.  
  87. extern pascal void ShutDwnStart(void )
  88.  THREEWORDINLINE(0x3F3C, 0x0002, 0xA895);
  89.  
  90. extern pascal void ShutDwnInstall(ShutDwnUPP shutDownProc, short flags)
  91.  THREEWORDINLINE(0x3F3C, 0x0003, 0xA895);
  92.  
  93. extern pascal void ShutDwnRemove(ShutDwnUPP shutDownProc)
  94.  THREEWORDINLINE(0x3F3C, 0x0004, 0xA895);
  95.  
  96. #endif
  97.  
  98. #if PRAGMA_ALIGN_SUPPORTED
  99. #pragma options align=reset
  100. #endif
  101.  
  102. #if PRAGMA_IMPORT_SUPPORTED
  103. #pragma import off
  104. #endif
  105.  
  106. #ifdef __cplusplus
  107. }
  108. #endif
  109.  
  110. #endif /* __SHUTDOWN__ */
  111.  
  112.